/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.pdx.cs.guavadata.data;

import edu.pdx.cs.guavadata.domain.Domain;

/**
 *
 * @author VuTran
 */
public class Column {
    private String columnName;
    public Domain dom;

    public Column(String columnName, Domain dom) {
        this.columnName = columnName;
        this.dom = dom;
    }

    @Override
    public String toString() {
        return columnName + " " + dom.getDBType();
    }

    @Override
    protected Column clone() throws CloneNotSupportedException {
        return new Column(columnName, dom);
    }

    @Override
    public boolean equals(Object obj) {
       if (!(obj instanceof Column)) return false;
       Column c = (Column) obj;
       return (this.columnName.equals(c.columnName) && this.dom.equals(c.dom));
    }

    @Override
    public int hashCode() {
        return columnName.hashCode() + dom.hashCode();
    }

    /**
     * @return the columnName
     */
    public String getColumnName() {
        return columnName;
    }

    /**
     * @param columnName the columnName to set
     */
    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }


}
